package com.leyou.config;

import com.leyou.interceptors.UserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Eric
 * @version v1.0
 * @package com.leyou.config
 * @date 2019/7/11 17:13
 * @description:
 **/
@Configuration
public class MvcConfig implements WebMvcConfigurer {


    @Autowired
    private JwtProperties prop;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInterceptor(prop)).addPathPatterns("/**");
    }
}
